<!--

    This file is part of kanji-portal.com.

    kanji-portal.com is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    kanji-portal.com is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with kanji-portal.com.  If not, see <http://www.gnu.org/licenses/>.

    Copyright (c) 2008-2009 Nicolas Radde <nicolas@radde.org>

-->
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a="http://richfaces.org/a4j"
                xmlns:s="http://jboss.com/products/seam/taglib"
                template="#{theme.template}">

    <!-- content -->
    <ui:define name="content">

        <fieldset id="kanji">
            <legend>#{messages['kanji.view.text.kanji']}(
                <s:link view="/kanji/edit.seam" propagation="none" value="#{messages['kanji.view.slink.edit']}">
                    <f:param name="kanjiId" value="#{kanji.id}"/>
                </s:link>)
            </legend>

            <div id="charbox">
                <div id="char">
                    #{kanji.kanji}
                </div>
                <div id="meanings">
                    <h:outputText value="#{messages['kanji.view.ot.nomeanings']}"
                                  rendered="#{meanings != null and meanings.rowCount==0}"/>
                    <ui:repeat value="#{meanings}" var="link">
                        <h:outputText value="," rendered="#{meanings.rowIndex != 0}"/>
                        #{link.meaning.meaning}
                    </ui:repeat>
                </div>
            </div>

            <div id="references">
                <h:outputText value="#{messages['kanji.view.ot.noreferences']}"
                              rendered="#{references != null and references.rowCount==0}"/>
                <ui:repeat value="#{references}" var="link">
                    #{link.reference.referenceType.name} : #{link.reference.value}
                    <br/>
                </ui:repeat>
            </div>

            <div id="tags">
                <h:outputText value="#{messages['kanji.view.ot.notags']}"
                              rendered="#{tags != null and tags.rowCount==0}"/>
                <ui:repeat value="#{tags}" var="link">
                    #{link.tag.name}
                    <br/>
                </ui:repeat>
            </div>
        </fieldset>

        <fieldset id="description">
            <legend>#{messages['kanji.view.text.description']}</legend>
            #{kanji.description}
        </fieldset>

        <fieldset id="prononciations">
            <legend>#{messages['kanji.view.text.spellings']}</legend>
            <h:outputText value="#{messages['kanji.view.ot.notags']}"
                          rendered="#{otherSpellings != null and otherSpellings.rowCount==0}"/>
            <ui:repeat value="#{otherSpellings}" var="ospel">
                #{ospel.type.name} : #{ospel.kana}
                <br/>
            </ui:repeat>
            <ui:repeat value="#{japaneseSpellings}" var="jspel">
                #{jspel.type.name} : #{jspel.kana}
                <br/>
            </ui:repeat>
        </fieldset>

    </ui:define>

</ui:composition>
